<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>嗨扑米-查看详情</title>
<link href="css/global.css" rel="stylesheet" type="text/css">
<link href="css/details.css" rel="stylesheet" type="text/css">
<link rel="icon" href="images/haipumi.ico"/> 

<!--下面是本页面的js-->
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/yhj_details.js"></script>

<!--下面是任务块的js-->
<link href="css/lk_img_preview.css" rel="stylesheet" type="text/css" />
<link href="css/lk_cool_effects.css" rel="stylesheet" type="text/css" />
<script src="js/lk_cool_effects.js"></script>
<link rel="stylesheet" href="css/sweet-alert.css"/>
<script src="js/sweet-alert.min.js" type="text/javascript"></script>
</head>
<body>
	<div class="yhj_body_zindex">
    	<!--头部内容开始 -->
        <iframe class="yhj_head" src="head.jsp"></iframe>
        <!--头部内容结束-->
        <div class="yhj_quickregister_0"></div><!--只是用来占位的-->
        
         <!--聊天小块-->
    <div id="lk_cool_effects_chatDiv_zindex">
        <div id="lk_cool_effects_chatDiv">
            <div class="lk_cool_effects_chatDiv_left"></div>
            <div class="lk_cool_effects_chatDiv_right">
                <div class="lk_cool_effects_chatDiv_right_top">x</div>
                <div class="lk_cool_effects_chatDiv_right_down">></div>
            </div>
        </div>
        <div id="lk_cool_effects_chatDiv_list">
            <div id="lk_cool_effects_chatDiv_contents">
            	<div class="lk_cool_effects_chatDiv_contents_left">
                	<div class="lk_cool_effects_chatDiv_contents_left_find">
                    	<input type="text" placeholder="查找联系人"/>
                    </div>
                    <div class="lk_cool_effects_chatDiv_contents_left_friendList">
                    	<ul>
                        	<li style="background:#EEE"><img src="images/u=1199138010,649592102&fm=21&gp=0.jpg"/><span>嗨扑米客服</span></li>
                            <li><img src="images/lk_cool_effects_img1.gif"/><span>好友在线</span><a>X</a></li>
                            <li><img class="lk_cool_effects_chatDiv_contents_left_friendList_offline" src="images/lk_cool_effects_img1.gif"/><span>好友离线</span><a>X</a></li>
                            <li><img class="lk_cool_effects_chatDiv_contents_left_friendList_offline" src="images/dog.jpg"/><span>好友2</span><a>X</a></li>
                        </ul>
                    </div>
                </div>
                <div class="lk_cool_effects_chatDiv_contents_right">
                	<div class="lk_cool_effects_chatDiv_contents_right_title"><span>嗨扑米客服</span></div>
                    <div class="lk_cool_effects_chatDiv_contents_right_message">
                    	<div class="lk_cool_effects_chatDiv_contents_right_message_none">
                        	<img src="images/lk_plaint.gif"/>
                            <p>还没收到消息哦</p>
                        </div>
                        <div class="lk_cool_effects_chatDiv_contents_right_message_chat">
                        	
                        </div>
                    </div>
                </div>
            </div>
            <div class="lk_cool_effects_chatDiv_list_left">
                <div class="lk_cool_effects_chatDiv_list_left_input"><input type="text" autofocus min=1 placeholder="按回车发送信息"/></div>
            </div>
            <div class="lk_cool_effects_chatDiv_list_right"><</div>
        </div>
    </div>
    <!--聊天小块结束-->
        
        <!--中间内容开始，-->
        <div class="yhj_content_zindex">
        	<div class="yhj_content">
                <div class="yhj_content_maincontent">
                	<div class="yhj_content_maincontent_left">
                    	<!--内容区域-->
                        <div class="yhj_content_maincontent_center_normalcontent">
                        	<div class="yhj_content_maincontent_center_normalcontent_userhead">
                        		<img id="yhj_content_maincontent_center_normalcontent_uimage" src="images/headphotos/${detailsession.uimage}" width="70" height="70"/>
                            </div>
                            <div class="yhj_content_maincontent_center_normalcontent_userinfo">
                            	<h2 class="yhj_content_maincontent_center_normalcontent_userinfo_name" tid="${detailsession.tid}">${detailsession.ualais}</h2>
                                <p class="yhj_content_maincontent_center_normalcontent_userinfo_introduce">
                                	<!--  他很懒，什么也没有留下~-->
                                	任务详情
                                </p>
                            </div>
                        </div>
                        
                        <div class="yhj_content_maincontent_center_conternt" style="width:693px;">
                            <div class="lk_taskInfo_person" style="width:693px;" >
                                <div class="lk_taskInfo_person_info">
                                    <div class="lk_taskInfo_person_info_type">
                                        <ul>
                                            <li>${detailsession.ttname}</li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="lk_index_taskInfo" style="width:693px;">
                                <div class="lk_index_taskInfo_describe" style="width:693px;">
                                    <ul>
                                        <li>${detailsession.tsendtime}</li>
                                        <li>天气:${detailsession.tweather}</li>
                                        <li>悬赏积分:${detailsession.treward}</li>
                                        <li>地点:${detailsession.taddr}</li>
                                    </ul>
                                </div>
                                <div class="lk_preview_img_moreInfo"  style="width:693px;"><a>&nbsp;&nbsp;任务详情:</a></div>
                                <div class="lk_preview_img_moreInfoDiv"  style="width:693px;display:block;margin:10px 0px">
                                    <p>${detailsession.tmore}</p>
                                </div>
                                <div class="lk_preview_img_ControlDiv" style="width:693px;"><a>&nbsp;&nbsp;任务相关图片:</a></div>
                                <div class="lk_preview_img_small" style="display:block">
                                    <img class="lk_small_img" src="images/taskPhoto/${ detailsession.tphoto}"/>
                                </div>
                                 <div class="lk_index_taskInfo_buttonDiv" style="display:none">
                                    <div class="lk_index_taskInfo_button_1">接收</div>
                                    <div  class="lk_index_taskInfo_button_line"></div>
                                    <div class="lk_index_taskInfo_button_2">❤关注</div>
                                    <div  class="lk_index_taskInfo_button_line"></div>
                                    <div class="lk_index_taskInfo_button_3" >评论</div>
                                    <div  class="lk_index_taskInfo_button_line"></div>
                                    <div class="lk_index_taskInfo_button_4">屏蔽</div>
                                </div>
                                <div class="lk_index_taskInfo_discuss" style="width:693px;display:block">
                                    <div class="lk_index_taskInfo_discuss_triangle" style="right:307px;display:none"></div>
                                    <div class="lk_index_taskInfo_discuss_input">
                                        <div class="lk_index_taskInfo_discuss_input_div">
                                            <div class="lk_index_taskInfo_discuss_input_div_head"><img src="images/headphotos/${detailsession.uimage}"/></div>
                                            <div class="lk_index_taskInfo_discuss_input_div_input"><input type="text" maxlength="140"/></div>
                                            <div class="lk_index_taskInfo_discuss_input_div_send" tid="${detailsession.tid}">评论</div>
                                        </div>
                                    </div>
                                    <div class="lk_index_taskInfo_discuss_list" >
                                        <div class="lk_index_taskInfo_discuss_list_type">
                                            <ul>
                                                <li>全部</li>
                                                <li>|</li>
                                                <li>热门</li>
                                            </ul>
                                        </div>
                                        
                                        <div id="lk_reply_list_show" class="lk_reply_list_show">
                                        
                                        </div>
                                        <div class="lk_index_taskInfo_skip"></div>
                                    </div>
                                </div>
                            </div> 
                        </div>
                        
                        <div id="lk_preview_img_big">
                            <!--显示预览图的块-->
                            <img src=""/>
                        </div>
                        
                    </div>
                    <!--现在内容部分只有左右两块了-->
                    <div class="yhj_content_maincontent_right">
                    	<div class="yhj_content_maincontent_right_content1" style="padding-top:10px;padding-left:15px;">
                        	<img src="images/yhj_20150907162845.png" width="260px" />
                        	<img src="images/yhj_20150907162845.png" width="260px" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--中间内容结束-->
        
        <!--foot内容开始 -->
        <iframe class="yhj_foot" src="foot.html"></iframe>
        <!--foot内容结束-->
        
        <!--  Totop按钮-->
        <div class="yhj_totop">
            <img src="images/yhj_right39.png" width="40" height="40"/>
        </div>
        <!--按钮结束-->
    </div>
</body>
<script>
	$(function(){
		//查询任务评论
		$.ajax({
			type:"POST",
			url:"task.action",
			data:"op=findTaskReply&tid="+$(".yhj_content_maincontent_center_normalcontent_userinfo_name").eq(0).attr("tid"),
			dataType:"JSON",
			success: function(data){
				var tablestring="";
				for(var i=0;i<data.obj.length;i++){
					var item=data.obj[i];
					if(item.robj=="0"){//item.robj  默认为0 表示是对该任务的评论						
						//对时间戳进行裁剪
						item.rdatetime=lk_showTime( ( (item.rdatetime).substring(0, 16) ),"reply");
						//对评论数处理,没有人时,为null,优化显示效果
						if(item.rsupportid=="null"){
							item.rsupportid="0";
						}
						//中间加其他的html代码
						tablestring+='<div><div class="lk_index_taskInfo_discuss_list_info"><div class="lk_index_taskInfo_discuss_list_info_head"><img src="images/headphotos/'+item.uimage+'"/></div><div class="lk_index_taskInfo_discuss_list_info_contents"><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint"><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_name">'+item.ualais+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_info">:'+item.rcontent+'</span></div><div class="lk_index_taskInfo_discuss_list_info_contents_statuts"><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_time">'+item.rdatetime+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_sustain">赞同 '+item.rsupportid+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_reply" >回复</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line_2">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_report">举报</span></div></div></div><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_reply"><input type="text"/><div  class="lk_index_taskInfo_discuss_input_div_send" tid="'+item.tid+'" rid="'+item.rid+'">评论</div></div><div class="lk_index_taskInfo_discuss_list_info_line"></div></div>';
						tablestring=lk_findChildrenReply(data,tablestring,item.rid);
					}
				}
				$("#lk_reply_list_show").html(tablestring);
				//为新刷出来的内容绑定事件
				lk_reply_bind();
			}
		});
	});
	
	function lk_reply_bind(){//信息块事件的绑定方法,为了在局部刷新时,调用这个方法,给新刷出来的	
		//举报span出现事件
		$(".lk_index_taskInfo_discuss_list_info").unbind();//避免重复绑
		$(".lk_index_taskInfo_discuss_list_info").bind({
			mouseenter:function(){
				var obj=$(this).children("div").eq(1).children("div").eq(1).children(".lk_index_taskInfo_discuss_list_info_contents_statuts_report");//获取举报span对象
				obj.css("display","block");//span显示
				obj.prev().css("display","block");//竖线显示	
				$(this).children(".lk_index_taskInfo_discuss_list_info_contents_statuts_report").css("display","block");
			},
			mouseleave:function(){
				var obj=$(this).children("div").eq(1).children("div").eq(1).children(".lk_index_taskInfo_discuss_list_info_contents_statuts_report");//获取举报span对象		
				obj.prev().css("display","none");
				obj.css("display","none");
				$(this).children(".lk_index_taskInfo_discuss_list_info_contents_statuts_report").css("display","none");
			}
		});
		
		//评论赞同事件
		//TODO 不能重复点赞
		$(".lk_index_taskInfo_discuss_list_info_contents_statuts_sustain").unbind();//避免重复绑
		$(".lk_index_taskInfo_discuss_list_info_contents_statuts_sustain").bind("click",function(){
			var currentUserPhoto=$("#currentUserPhoto").attr("photo");
		    if(currentUserPhoto==""){
		    	swal({
		    		  title: "请先登陆哦!",
		    		  text: "您是否要跳转到登陆页面?",
		    		  type: "info",
		    		  showCancelButton: true,
		    		  confirmButtonColor: "#DD6B55",
		    		  confirmButtonText: "好的,我要登陆!",
		    		  cancelButtonText:"我现在不想登陆",
		    		  closeOnConfirm: false
		    		},
		    		function(){
		    		  location.href="login.html";
		    		});
		    	return;
		    }else{
		    	var oldnum=$(this).text().substring(3);
		    	$(this).text("赞同 "+(parseInt(oldnum)+1) );
		    }
		});
		
		//回复别人的评论块
		$(".lk_index_taskInfo_discuss_list_info_contents_statuts_reply").unbind();//避免重复绑
		$(".lk_index_taskInfo_discuss_list_info_contents_statuts_reply").bind("click",function(){
			var currentUserPhoto=$("#currentUserPhoto").attr("photo");
		    if(currentUserPhoto==""){
		    	swal({
		    		  title: "请先登陆哦!",
		    		  text: "您是否要跳转到登陆页面?",
		    		  type: "info",
		    		  showCancelButton: true,
		    		  confirmButtonColor: "#DD6B55",
		    		  confirmButtonText: "好的,我要登陆!",
		    		  cancelButtonText:"我现在不想登陆",
		    		  closeOnConfirm: false
		    		},
		    		function(){
		    		  location.href="login.html";
		    		});
		    	return;
		    }
			if($(this).parent().parent().parent().next().css("display")=="none"){
				//记录回复对象的名字
				var reply_name=$(this).parent().prev().children(".lk_index_taskInfo_discuss_list_info_contents_viewpoint_name").text();
				//记录input内容信息
				var reply_obj=$(this).parent().parent().parent().next().css("display","block").children().val();
				//用于判断是否需要刷新input内容信息
				var reply_str="回复@"+reply_name+":";
				if(reply_obj.length>=reply_str.length){
					//先清空,再填充,为了去除文字全选的效果
					$(this).parent().parent().parent().next().css("display","block").children().val("").select().val(reply_obj)
				}else{
					$(this).parent().parent().parent().next().css("display","block").children().select().val("回复@"+reply_name+":");
				}
			}else{
				//input失去焦点事件
				$(this).parent().parent().parent().next().css("display","none").children().blur();
			}
		});
		
		//评论块点击弹出事件
		$(".lk_index_taskInfo_button_3").unbind();//避免重复绑
		$(".lk_index_taskInfo_button_3").bind("click",function(){
			if($(this).parent().next().css("display")=="none"){
				$(this).parent().next().slideDown("fast").children("div :eq(1)").children().children("div :eq(1)").children().select();//选择input
				//取到回复块的对象
				var replyObj= $(this).parent().next().children('.lk_index_taskInfo_discuss_list').children('.lk_reply_list_show');
				//用ajax 向服务器请求该任务的评论信息
				$.ajax({
					type:"POST",
					url:"task.action",
					data:"op=findTaskReply&tid="+$(this).attr("tid"),
					dataType:"JSON",
					success: function(data){
						var tablestring="";
						for(var i=0;i<data.obj.length;i++){
							var item=data.obj[i];
							if(item.robj=="0"){//item.robj  默认为0 表示是对该任务的评论						
								//对时间戳进行裁剪
								item.rdatetime=lk_showTime( ( (item.rdatetime).substring(0, 16) ),"reply");
								//对评论数处理,没有人时,为null,优化显示效果
								if(item.rsupportid=="null"){
									item.rsupportid="0";
								}
								//中间加其他的html代码
								tablestring+='<div><div class="lk_index_taskInfo_discuss_list_info"><div class="lk_index_taskInfo_discuss_list_info_head"><img src="images/headphotos/'+item.uimage+'"/></div><div class="lk_index_taskInfo_discuss_list_info_contents"><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint"><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_name">'+item.ualais+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_info">:'+item.rcontent+'</span></div><div class="lk_index_taskInfo_discuss_list_info_contents_statuts"><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_time">'+item.rdatetime+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_sustain">赞同 '+item.rsupportid+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_reply" >回复</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line_2">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_report">举报</span></div></div></div><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_reply"><input type="text"/><div  class="lk_index_taskInfo_discuss_input_div_send" tid="'+item.tid+'" rid="'+item.rid+'">评论</div></div><div class="lk_index_taskInfo_discuss_list_info_line"></div></div>';
								tablestring=lk_findChildrenReply(data,tablestring,item.rid);
							}
						}
						replyObj.html(tablestring);
						//为新刷出来的内容绑定事件
						lk_reply_bind();
					}
				});
				
			}else{
				$(this).parent().next().slideUp("fast");
			}
		});	
		
		//回复信息事件
		$(".lk_index_taskInfo_discuss_input_div_send").unbind();//避免重复绑
		$(".lk_index_taskInfo_discuss_input_div_send").bind("click",function(){
			var currentUserPhoto=$("#currentUserPhoto").attr("photo");
		    if(currentUserPhoto==""){
		    	swal({
		    		  title: "请先登陆哦!",
		    		  text: "您是否要跳转到登陆页面?",
		    		  type: "info",
		    		  showCancelButton: true,
		    		  confirmButtonColor: "#DD6B55",
		    		  confirmButtonText: "好的,我要登陆!",
		    		  cancelButtonText:"我现在不想登陆",
		    		  closeOnConfirm: false
		    		},
		    		function(){
		    		  location.href="login.html";
		    		});
		    	return;
		    }
			//判断是回复任务,还是回复用户
			var obj=$(this);
			var lk_objClass=obj.parent().attr("class");
			var lk_length=0;
			var lk_flag=0;
			var discuss_info;//发表的评论
			if(lk_objClass=="lk_index_taskInfo_discuss_input_div"){//对任务的评论的this 父类class
				discuss_info=obj.prev().children("input").val();
				lk_flag=1;
				lk_length=discuss_info.length;
				//添加评论任务信息
				$.ajax({
					type:"POST",
					url:"task.action",
					data:"op=addTaskReply&rcontent="+discuss_info+"&tid="+$(this).attr("tid"),
					dataType:"JSON",
					success: function(data){
						if(data.code==1){
							//用js显示信息在主页面上
							lk_JsShowTaskReply(obj,discuss_info,lk_length,lk_flag,data.obj.rid,data.obj.tid);
							lk_reply_bind();
						}else{
							sweetAlert(data.msg);
						}
					}
				})
			}else if(lk_objClass=="lk_index_taskInfo_discuss_list_info_contents_viewpoint_reply"){//对评论的评论的this 父类class				
				discuss_info="<font style='color:blue'>"+obj.prev().val()+"</font>";
				lk_flag=2;
				lk_length=discuss_info.length;//需要优化判断  对于是否要自动恢复用户名字的bug	TODO
				//添加评论任务信息
				$.ajax({
					type:"POST",
					url:"task.action",
					data:"op=addTaskReply&rcontent="+discuss_info+"&tid="+$(this).attr("tid")+"&rid="+$(this).attr("rid"),
					dataType:"JSON",
					success: function(data){
						if(data.code==1){
							//用js显示信息在主页面上
							lk_JsShowTaskReply(obj,discuss_info,lk_length,lk_flag,data.obj.rid,data.obj.tid);
							lk_reply_bind();
						}else{
							sweetAlert(data.msg);
						}
					}
				})
			}
			
		});
	}
	
	function lk_showTime(time,reply){
		var nowDay=( lk_showNowTime() ).substring(0, 10);
		var timeMore="";
		if(reply=="reply"){
			timeMore=time.substring(10, 16);// 对于在评论区域,要加小时分钟
		}
		time=time.substring(0, 10);
		//显示为今天
		if(time==nowDay){
			return "今天"+timeMore;
		}else{
			return time+timeMore;
		}
	}
	
	function lk_showNowTime(){
		var nowdata=new Date();
		var year=nowdata.getFullYear();
		var month=nowdata.getMonth()+1;
		var day=nowdata.getDate();
		var hours=nowdata.getHours();
		var minutes=nowdata.getMinutes();
		if(month<10){
			month="0"+month;
		}
		if(day<10){
			day="0"+day;
		}
		if(hours<10){
			hours="0"+hours;
		}
		if(minutes<10){
			minutes="0"+minutes;
		}
		return year+"-"+month+"-"+day+" "+hours+":"+minutes;
	}
	
	//用递归的算法查询子评论的方法
	function lk_findChildrenReply(data,str,rid){
		//判断是否有子评论
		for(var j=0;j<data.obj.length;j++){
			var itemChildren=data.obj[j];
			//添加子评论
			if(itemChildren.robj==rid ){
				//对时间戳进行裁剪
				itemChildren.rdatetime=(itemChildren.rdatetime).substring(0, 16);
				//对评论数处理,没有人时,为null,优化显示效果
				if(itemChildren.rsupportid=="null"){
					itemChildren.rsupportid="0";
				}
				str+='<div><div class="lk_index_taskInfo_discuss_list_info"><div class="lk_index_taskInfo_discuss_list_info_head"><img src="images/headphotos/'+itemChildren.uimage+'"/></div><div class="lk_index_taskInfo_discuss_list_info_contents"><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint"><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_name">'+itemChildren.ualais+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_info">:'+itemChildren.rcontent+'</span></div><div class="lk_index_taskInfo_discuss_list_info_contents_statuts"><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_time">'+itemChildren.rdatetime+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_sustain">赞同 '+itemChildren.rsupportid+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_reply" >回复</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_line_2">|</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_report">举报</span></div></div></div><div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_reply"><input type="text"/><div  class="lk_index_taskInfo_discuss_input_div_send" tid="'+itemChildren.tid+'" rid="'+itemChildren.rid+'">评论</div></div><div class="lk_index_taskInfo_discuss_list_info_line"></div></div>';
				str=lk_findChildrenReply(data,str,itemChildren.rid);
			}
		}
		return str;
	}
	
	function lk_JsShowTaskReply(obj,discuss_info,lk_length,lk_flag,rid,tid){
		//用js在页面显示消息
		if(lk_length>0 && lk_flag!=0){		
			//TODO
			var discuss_img=$("#yhj_content_maincontent_center_normalcontent_uimage").attr("src");//个人头像路径
			var discuss_name=$(".yhj_content_maincontent_center_normalcontent_userinfo_name").eq(0).text();	//个人名字
			var discuss_time=lk_showTime( lk_showNowTime(),"reply" );//评论时间

			var mainDiv=$('<div></div>');//主块
			var div1=$('<div class="lk_index_taskInfo_discuss_list_info"></div>');//大块
			var div2=$('<div class="lk_index_taskInfo_discuss_list_info_head"><img src="'+discuss_img+'"/></div>');//头像块
			var div3=$('<div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint"></div>');//名字+评论信息块
			var div4=$('<div class="lk_index_taskInfo_discuss_list_info_contents"></div>');//内容块
			var div6=$('<div class="lk_index_taskInfo_discuss_list_info_contents_statuts"></div>');//状态块
			div6.html('<span class="lk_index_taskInfo_discuss_list_info_contents_statuts_time">'+discuss_time+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_statuts_sustain">赞同 0</span><span  class="lk_index_taskInfo_discuss_list_info_contents_statuts_line">|</span><span  class="lk_index_taskInfo_discuss_list_info_contents_statuts_reply">回复</span><span  class="lk_index_taskInfo_discuss_list_info_contents_statuts_line_2">|</span><span  class="lk_index_taskInfo_discuss_list_info_contents_statuts_report">举报</span>');//填充状态块
			div3.html('<span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_name">'+discuss_name+'</span><span class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_info">:'+discuss_info+'</span>');//填充名字+回复信息
			div4.append(div3,div6);//往内容块添加个人信息节点
			div1.append(div2,div4);//往大块添加头像块和内容块
			var div7=$('<div class="lk_index_taskInfo_discuss_list_info_contents_viewpoint_reply"><input type="text"/><div class="lk_index_taskInfo_discuss_input_div_send" rid="'+rid+'" tid="'+tid+'">评论</div></div>');//对回复的评论块
            var div8=$('<div class="lk_index_taskInfo_discuss_list_info_line"></div>');//分割线
			mainDiv.append(div1,div7,div8);//评论块完成
			if(lk_flag==1){
				mainDiv.insertBefore($(".lk_index_taskInfo_skip"));//放在链接前
				obj.prev().children("input").val("");
			}else if(lk_flag==2){
				mainDiv.insertAfter(obj.parent().parent() );
				obj.parent().css("display","none");
			}
		}
	}

</script>
</html>
